package com.itheima.demo;

public class Demo01 {
    public static void main(String[] args) throws Exception {
        /*//1. 读取核心配置文件
        InputStream is = Resources.getResourceAsStream("sqlConfig.xml");
        //2. 构建SqlSessionFactory对象(构建者模式)
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(is);
        //3. 获取SqlSession
        SqlSession sqlSession = sqlSessionFactory.openSession();
        //4. 获取代理对象
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        //5. 调用方法
        UserInfo userInfo = mapper.findById(1);
        System.out.println(userInfo);
        //6. 提交事务
        sqlSession.commit();
        //7. 释放资源
        sqlSession.close();*/
    }
}
